package com.longjianghuasheng.logistics.business.billing_period.fragment

import android.os.Bundle
import com.longjianghuasheng.logistics.R
import com.longjianghuasheng.logistics.base.BaseMultiStateFragment
import com.longjianghuasheng.logistics.business.billing_period.BillingPeriodViewModel
import com.longjianghuasheng.logistics.business.billing_period.adapter.AccountDetailsAdapter
import com.longjianghuasheng.logistics.databinding.FragmentBillingPeriodBinding
import com.longjianghuasheng.logistics.ext.initLinerDecoration
import com.zackratos.ultimatebarx.ultimatebarx.addStatusBarTopPadding

class BillingPeriodFragment :
    BaseMultiStateFragment<BillingPeriodViewModel, FragmentBillingPeriodBinding>() {

    private val accountDetailsAdapter by lazy {
        AccountDetailsAdapter()
    }

    override fun layoutId(): Int = R.layout.fragment_billing_period

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        mDatabind.run {
            clBg.addStatusBarTopPadding()
            ivBack.setOnClickListener { navigateUp() }

            btBill.setOnClickListener { navigate(R.id.billingDatesFragment) }
            btQuota.setOnClickListener { navigate(R.id.quotaFragment)}

            rvDetail.initLinerDecoration(adapter = accountDetailsAdapter)
        }
    }

    override fun createObserver() {
        super.createObserver()
    }

    override fun initData() {
        super.initData()
    }

    override fun lazyLoadData() {
        super.lazyLoadData()
        accountDetailsAdapter.setNewInstance(MutableList(5) { "" })

    }


}